/****** Object:  StoredProcedure [dbo].[AddCOIUserHierarchyMap]    Script Date: 03/04/2009 12:53:11 ******/
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].UpdateProtocolStudyStaffToCertifyAgain') AND type in (N'P', N'PC'))
DROP PROCEDURE [dbo].UpdateProtocolStudyStaffToCertifyAgain
GO
/******************************************************************            
* Name:						UpdateProtocolStudyStaffToCertifyAgain            
* Note:						Will be used for animals TR(triennial reviews) by updating
*							AddedprtocolProcessId to current one in that table 
*							so users will be picked up to certify again.
* PARAMETERS(IN)            
* Name						Description                 
* -------------			   -------------------------------------------            
* @protocolProcessId        Id to update the Staff Table 
*********************************************************************/            
            
CREATE PROCEDURE [dbo].UpdateProtocolStudyStaffToCertifyAgain
(            
	@protocolProcessId	INT,
	@protocolNumber		VARCHAR(50)
)            
AS BEGIN    
        
SET NOCOUNT ON            
            
	UPDATE ProtocolStaff_map
	SET AddedProtocolProcessId =  @protocolProcessId
	WHERE ProtocolNumber = @protocolNumber
	AND ProtocolStaffTypeId != 13
	And IsCurrent = 1

END    

GO


